package demo2;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ASUS
 * Date: 2023-11-06
 * Time: 17:13
 */
class Student{
    private String name;
    private int age;
    private static String classRoom = "301";


    public Student() {
        System.out.println("不带参数的构造方法");
    }
    public Student(String name,int age) {
        this.name = name;
        this.age = age;
        System.out.println("调用带2个参数的构造方法");
    }


    public void  print() {


        System.out.println("姓名："+this.name+"年龄:"+this.age);
        {

            System.out.println("普通代码块：没有实际的意义，执行这个代码块没有任何的作用");
        }
    }


}
public class Test1 {
    public static void main(String[] args) {
        Student student = new Student();
        student.print();
    }


}
